<? 

class class_uri {
    private $uri;
    private $arraydata; 

    function class_uri($arrayconfig){

         $host=$_SERVER['HTTP_HOST'];
         list($sub,$b)=explode(".".domain,$host);
         list($urinow,$urinow2)=explode("?",$_SERVER['REQUEST_URI']);
         $arrayuri=explode("/",$urinow);


          $arraydata=array();

          if($arrayuri[0]==""&&$arrayuri[1]==""&&is_file(rootpath.'/includes/class/'.homeclass.".php"))
          {
          
          $arraydata['class']=homeclass;
          
          }else
          {
          if(count($arrayconfig['feature']))
          {
          $check=0;
          foreach($arrayconfig['feature'] as $valueconfig)
          {

          if($valueconfig['link']==$arrayuri['1']&&$valueconfig['show']==1)
          {
          break;
          }
          
          $check++;
          }
          
          
          
   
          
          
          if(is_file(rootpath.'/includes/class/'.$arrayconfig['feature'][$check]['class'].'.php'))
          {

          $arraydata['class']=$arrayconfig['feature'][$check]['class'];
          if(count($arrayuri)>2)
          {
            array_shift($arrayuri);
            array_shift($arrayuri);
          $arraydata['parameter']= $arrayuri; 
          
          }
          $arraydata['config']=$arrayconfig['feature'][$check];
          
          
          
          }
          else if(is_file(rootpath.'/includes/class/'.$arrayuri[1].'.php'))
          {
          $arraydata['class']=$arrayuri[1];
          if(count($arrayuri)>2)
          {
            array_shift($arrayuri);
            array_shift($arrayuri);
          $arraydata['parameter']= $arrayuri; 
          
          }
          
          }
          else
          {

          
           if(is_numeric($arrayuri[2]))
           {
           $arraydata['class']="feature";
           array_shift($arrayuri);
           $arraydata['parameter']=$arrayuri;         
           
           }else
           {
           $arraydata['class']="profile";
             
          if(count($arrayuri)>1)
          {

            array_shift($arrayuri);
          $arraydata['parameter']= $arrayuri; 
          
          }
          
           }
          
          }
          
          }
          
          else
          {
          
          $arraydata['class']=errorclass; 
          
          }
          
          
          
          }
          $arraydata['configall']=$arrayconfig;
          //   return    $arraydata;
          $this->arraydata= $arraydata;
    }
    function  getarraydata()
    {
    
          return $this->arraydata;
    
    }
   
   
} 
?>
